Fixed issue that would occur when dimensions are 0