Coerce None consistently, depending on the dtype of the container.

Fixes #7939.