Small optimisations in HUD code
Quick fix for error