Cleanup and Bugfixes