Fixed #863

 * Number of tests to run calculated incorrectly when --repeat is used
Merge branch '3.7'