Type checks for getDegree and getPath