restored proper flattening procedure for the slow path