Fix loading bugs