Fix NPE
Minor header fix
Change the way the pipeline buffer writes out data to better handle the connection close
Pipeline buffering bug fixes