Corrected handling of zero-quantity demands.
Bug identified by Marcel Lack.