Fixed plenty of bugs and migrated to new version