Fix pyXMLSecutiry backend, and add test case.