Bug fix in getTargetSGP from previous commit