fixed bug in cython wrapper

fixed critical bugs