Fix HTTP bugs for HAProxy support