Fixed bug in TestFunctions.simulate

Calling simulate with an empty event list could lead to an
IndexOutOfBounds exception being thrown.