Fix reset logic