FIX: new capacity could have been 0 leading to crashes (from Standard)