Merged with latest master

But some test still fails.
@lupatellimatteo can you check, please?