Added safeguards to leave.
Fixed server-sent events not working.
Merged files.