First step in fixing "ex_data" support. Warning: big commit log ...