Add support for debug builds

Fixes issue #280