Cleanup of print_events (I added some printing for debbuging).