Patches discovered when integrating into CMP, this is now working for us
in a real application.