Fix filename reading