Improved MatlabD3PD compilation