Some js bugfixes and tag lowercasing