Fixed loading bugs