Force principalId to be a string.

Added a defensive check for undefined to avoid problems
when converting to a string.
Adjust id handling to deal with 0 and null
Merge pull request #680 from arlaneenalra/feature/fix-676

Force principalId to be a string in Role.getRoles Fix #676