Fix bug in non-numba mode