Fixes

Please see commit messages.