Fixed failing tests and ad ed new tests for dirty fields