Fixed problem in lda.m; still untested