Fix local file optimisation