More safety-proofing for UI input.