Fixed typo, added debug code