Bug fixes in loadclass