Fix some compiler warnings.

It would be nice to port more of the cython code to use typed memoryviews instead of `cdef`d numpy arrays, too.