Minor fixes

Made over time some more minor fixes that you can find in this pull-request, the comment with every commit describes what is/why things are done.