Fixing an issue with add-matrices