Fixed an error in the debug system that occasionally caused debug printouts to be displayed instead of error ones.