Lots of cleanup & bugfixes