Removes redundant resets