Added a debug messages in a couple functions.