Tweaks to build system
Properly handling debug mode now