piecewise: some fix