Fixed some things in the loading code.