Fix mishap with dirty checking logic