Code only g1fix

This branch is a copy of my local g1fix after performing an interactive rebase to fludagwork and choosing the first four plus the final commit of Andy's update.

Once this branch is merged with fludagwork (after any comments/changes) the testing commits will be rebased and another pull request issued.