Add support for debug builds.
Merge pull request #281 from davehunt/debug

Add support for debug builds