Checkpoint in fixing bug in flattener