Make dev SSO munge script more robust

As prompted by @tombye.