class loader fixes and a few fixes for test