Counter cache compatibility fixes and tests

Follow up to #56