Add various tests
Fix instance counter