Small rewrite for validation edge-cases.