Ported fixes from SP3

bnc#813835, bnc#817006, bnc#719881

those fixes were already submitted and confirmed to work in SP3.