Fixes to KEYCLOAK-682
Merge pull request #694 from stianst/master

Fixes to KEYCLOAK-682