fixed handling of infinities