Fix filename/type recognition