Merged in Harrysouthworth:Master

This commit contains the merge from harrysouthworth:master. These were
mostly code clean up changes.