Sorting out some cython bugs