Adding in some minor bug fixes in summarizeSGP