fix Location::encode()