Fix bug with protected context