backport more awesome bugfixes