Adapted UnitTest and LayoutMath