Make empty/dirty atomic and immediate; reinstate George's patch b63a1e8

Unit tests were added which broke the earlier behavior, they now pass.