Fix failed tests in foreign counter.  Passes the same tests as the other implementations.