Fix code for converting tag names to lower case