Fixed #5: Assertion failed when training classifier.