Check if class exists - fixes #34