Fixed ‘undefined variable’ debug errors