Fix NPE warning; use locale for toLowerCase
Merge pull request #164 from bstansberry/no-protocol-npe

Fix NPE warning; use locale for toLowerCase