Fix bugs in ldmlflatten and add -c