Improve error when retrieve filename.