Improved the build script, added a DEBUG option