Fixes to optimise.