Fixing a bug with encoding to support AmazonEC2 servers