Fix a bug in code manager.