Merge pull request #8 from peter17/master

Corr. func. name per 82a4bad93
The Python sum function may return a float64 array even if the arguments are float32, so we need to force the result's dtype.

Adding more explicit error messages.