Fix issue preventing --extract-xslt from working correctly and add test