Changed to be more conservative when using a class' classloader. Fixed #154