Fixing the context instance bugs