Porting over modernise branch from WALADelta.