Fixed a few typos and removed debug code