fixed saving of event data, using string was a rather uninformed
choice, also fixed LUA stack overflow error on longer simulations, by
clearing the stack whenever an event is received.