fix topnav
fix obscure off-by-one-errors