fixes to debug mode, undefined error checks, corrected big icon