Fix a bug which leads to crash in exception-handling.

In the zero-pivot handling, when we are using the variable-bandwidth
option and there are two or more partitions, in the old versions
it will crash due to access out of memory.