Fixed some bugs with asset loading.