Simplify hier_prefix. Prevent prefix buffer underflow.