Fix singfun exponents

I can't push my change to DG's fork. So I'm re-issuing this pull request and will merge it soon.