Added debugs and other fromatting for debug messages.