Even more client fixes

There's three main parts. See the commit messages for more information.