Fixed handling of terminal letters.