A few improvements and fixes

Hopefully you like/agree with the changes, it seems to work well for me!