Re-apply r112539, being more careful to respect the return values of the constant...