Fixed compile errors in the diagrams backend.