Added support for querying a neighbor in a given direction.