Fix res.end patch

fixes #55