Fixed JS error when location.hash is empty or not a valid id.