Fix bug in predictor step, possible memory leak