Fixed a memory leak in get_class