Fixed a lot of findbugs issues with string encoding
Merge pull request #1649 from pveentjer/cleanup/stringencoding

Fixed a lot of findbugs issues with string encoding