Minor fixes. Adding support for a debug mode.