fix issue 2164 and issue 2182
Merge pull request #424 from timrae/studyOptionsFix

fix issue 2164 and issue 2182