Fix reset so it's not optimized away