Revert "Remove fakedLastChar hack"

This reverts commit 475b2be0da668724fa910dc70579820eb3ad905e.

Issue #2452
Issue #2384