Add analysis arguments and fix mergeSGP