Added a maximum input length.