Latest updates on the diagrams backend

I fixed all known issues with the diagrams backend and updated the tests.