Removes debugging messages, minor bugfixes