Updated logic error, and more.

Updated logic error, and changed comments/debug messages.