Fixed some bugs with the new object class file structure