Fix bug: cross validation tested on incorrect data

A bug reported by José Guilherme Camargo de Souza