Bug fixes

Correctly apply context