added memory fix to spmat
Merge remote-tracking branch 'origin/periodicale' into periodicale