Workaround for apparent scipy bug.