Fixed some bugs with loading