Another attempt to work around gcc isfinite problems