Unify character casts, reorganize checks
Merge pull request #244 from Dmitry-Me/unifyCharacterCasts

Unify character casts, reorganize checks