Fixed issue with dirty attributes and count attribute