some fixes for saml support