Bug fix: matrices' elements should be copied when assigning