Fix indexing of study level variables

Reviewer: Tiffany Go

Issue: GCP-8780