Fix filename replacement