Fixed several bugs related to the AssetManager