Fix ensure_loaded for local packages.
Remove useless code.