Added better input sanitation.