Fixed maxLength handling