Stopped shutting down the socket for writing after sending the HTTP response; it was causing an error. More permanent fix to come.