Fixed the problem when the test/training proportion changes