FIX for issue 915, updated comments and restored encoding information