fixed some known bugs in parsing http message