Fix for String.substr() if len exceeds the string length.
Fix for KeyboardEvent constructor not initializing its members.