Various bugfixes

Proofreading of code and fixing quite a few usability bugs...