Issue #1371: Move character val to end of '!=' or '=='

Signed-off-by: Anton Kovalyov <anton@kovalyov.net>