Fixed some bugs in EventSource