Cross validation bug fix