misc fixes for SAML