Correct pathtransform.m to avoid the creation of a full matrix when testing for
domain error (increase speed a lot in the case of large problems)