Fixed some optimisation issues