Miscellaneous fixes for XSL template