Fixed bug allocating modelVector.