Fixing issues with context changes