Clean up & bugfixes