More small bugs uncovered by randomtest.