Fix reset function to totally reset.