Fixed issue related to maxlength

1. Firefox defaults `maxLength` property to -1 so we must detect the
attribute existence or ensure the property is greater than 0
2. Fixed a typo