Add explicit handling for the case when setting both dimensions to zero