Bug fixes, removal of debug logging