Various bug fixes (related to $macc model testing)