finite() is deprecated on OSX 10.9, use isfinite().