Only set filename if there is a filename.