Small changes and fixes

You can cherry-pick single commits if you don't like all changes I made.