several fixes: build, bnc#796589, bnc#791076