Fix bug with dirty