fix division by zero when no allocations