Lowercase element's type attribute

Also remove second toLowerCase() on element's name

Closes #2.