Improved reset & fixed coding style (again)