Migrate skipCurrentChar() and checkValid()