Moved debugging code to more appropriate place

Refs #4443