Fixed a bug in the zero-threshold looping.