Fix a bug introduced while merging the monitor code