Added check for empty path to plotPath method.