Fix location header generation