Fixed warnings in code
Support optionalScopes in configuration