A couple of small bug fixes and updates.
The debug class has been made more generic.