Fixed a bug in size estimation of diagonal matrices

Also wrote a test and changed CHANGES.md