Added (untested) debug support.