Bugfix and Cleanup