Simplify scgi parser and fix