Corrected error in material thickness logic