Correct the way stable_primitive_sort is implemented for bool
Fix tests which called detail functions whose signatures have changed