Fix end event. Closes #28.