Fixed issue with single-quotes in element names

Thanks Tom!