REL-2155: fix bug in gpi guiding sequence

A bug was introduced in the implementation of REL-1743 in that the (p,q) values in the sequence didn't match the step being evaluated.  This change makes one substantive change in Gpi to get the correct (p,q) value for the step, and adds one sketchy test case.