fix file links being treated as directories