Fix context sharing
CR #327