Really fixed the library loading bug.

Made sure all necessary libraries are loaded before starting.