Encoding fixes. LetterPoint initialization fix. Minor refactoring changes