Fixing some typos and debug code left accidentally