DelegatingClassLoader fix, and unit tests