Scoping the context before asking for the currentPreset.

Fixes #1121.
Merge pull request #1122 from andrewkaufman/presetFix

Scoping the context before asking for the currentPreset.