Bug fix in outputSGP regarding converting variables