Fixed a few bugs introduced by the base model class added a while ago.