Remove leftover debugging trace.
Add shape checks when internalising fold functions.