Moved debug messages into proper blocks.

Some of the serial debug messages were outside the #ifndef ... #endif
blocks. This is now fixed.