Several small imrpovements

As discussed, here is a merge proposal with some small improvements. Feel free to merge it or let me know if you want to discuss it.