Removing unneeded debug statements, fixed typo, fixed None check.