Fixed issue arising when levels of a factor were dropped from the model