Cleanup and changes in monitor.