Bugfix, cleanup