Further change to model.cpp by Daniel Rabosky.