Add debug statements and fix typo.