Several small fixes and improvements
Merge pull request #7 from Gama11/patch-4

Several small fixes and improvements