Fix unit error
Optimise the draw legends feature