Fixes a bug in modelHasEvent.