Remove debug printing, bug fixes