Avoid some undefined errors when opening non-JS files