Fix small bug in substring hash