Fix fred

This fixes the example stats/MercerKarhunenLoeve.m that crashed in the nightly build. A test has been added.