Added useful debugging features and fixed reset