Removes unncessary calls to size() in Cypher trail building