Minor bugfixes in outputSGP