Fixed library loading and saving