Ensure illegal characters are rejected