Fixed a bug and added clean/dirty values