Simplify header anchor id logic, fix #2.