When triggering an event that doesn't have any callbacks, at present the for loop inside `trigger` fails. This fixes it and adds a test to verify.