Bug fixes
more bug fixes and final touches