Add counter cache compatibility

Resolves #55