Check if a library has been loaded before calling GetClass() again, to avoid potential infinite recursion (thanks Axel for the correct solution)