Bug Fixes

Fixed a few bugs in data model