Fix filename retrieval