fix($location): allow 0 in path() and hash()

This handles a corner case with numeric 0 after adb5c6d6cc76b928436743707727ab0974d6810b was merged.