Minor optimisations in hud code