Fix a minor bug in LocalContext