Fixed cleanup system
Added debug flag to build system