Numerous bugfixes to EventDrivenSimulator and CCD