Don't try to check the last char of an empty string.
Merge topic 'export-cleanups' into next

5c26f92 Don't try to check the last char of an empty string.