fixes #133; missing cl$ when referencing gpid

This fixes the bug leading to behaviour reported in #133 . The two references to `gpid` should have been `cl$gpid` to reference the parameters pass in via argument `cl`.

Closes #133 when merged.