Fixed bug of incorrect models in case of variable elimination.