Fixed some bugs.

When a state exits on the newline char, it has to push it back to its
parent. Otherwise, the parent state wouldn't know that the engine isn't
on the same line anymore.