Minor bugs and removing debugging statements.