Defend against bad input