Big ass commit as I'm going off on holiday.