Cleaned the library loader code