curve: fix getting Infinity