Fixed some issues with ending response (undocumented 'finish' event)