Fixed variable out of scope, disabled debug mode