matlab fixes, and fix tests for isfinite