Remove warnings

this can maybe fix #375 once it is backported to stable6 because it fixes errors and warnings, which could cause the automatic build to fail

@karlitschek what about a travis run on this, to see if the change cause those errors?

cc @jnweiger @wakeup @DeepDiver1975