Debugged mock2.py and fixed some bugs with monitor.py.