Corrected debugging code
Several updates: Improved debugging, modified event names, added property FCountingRecords.