Mergence of updates

There is some more to come but as we both check in against different code paths the merges from your code base are becoming more difficult to merge to mine so need to bring them back in line.