Fixed some bugs that were introduced with the new structure.