Fix content length bug, bi-dir code remove print space