fixes bugs in tests and a minor revision of logsumexp
Merge pull request #5 from lindahua/bugfixes

fixes bugs in tests and a minor revision of logsumexp