Prevent invalid filenames from the append text

Fixes #6