Fixed an error with {document} variable in the filename template