1.12+bugfix backports ii

This contains the bugfixes from last week (and a bit before) which we tested on master.

List of cherry-picked commits: http://hastebin.com/vududegidu.hs