Fix 'preview file' regression. Closes #1285.