Fix folding problems