Fixed some bugs in how data is loaded.