Resolve #169
Fix #168
Fix #180
Fix #171
Still optimisation to do but resolves #181
Fix #177
Various tweaks