Fixed another couple of bugs the static analyzer caught. Removed leftover debug print statements.