Rec.hs: fix an error, and simplify code