Adding a few fixes for prediction and validation routines.