Remove the # mark when location.hash == ""

Also made a minor `javascript:void(0)` -> `#` replacement, which works because `e.preventDefault()` is called in a click handler.