Make sure the value of maxlength is valid (see #56)