Fix traceback on quote in filename

Fixes #1109