Workaround for apparent scipy bug.

This solves the segfault in #440 for me