Bug fixes and cleanup
Merge pull request #4 from simonschaufi/bugfixesAndCleanup

Bug fixes and cleanup