Some smaller improvements

Hey Vladimir!

I've made a bunch of smaller improvements and separated them by commits. If you only like a subset of those, you're welcome to cherry-pick them :)