Fixed some loading order bugs.