Added sanity test. Changed global counter.