Optimisations and fixes
Fix an accidentally committed blunder