Whoops, put setDirty(false) in the wrong method.