0.0.5: link replacement fix and optimisation