Add support for debug builds (fixes issue #280)