Fixed loading bug when running in an extension.