Fix test_scaffolds bugs.