small fixes for prediction code