Fixed an index eror in predict.