This resolves bug 2232, bug 2607 and bug 2946. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit dfe3c9649f)
dfe3c9649f