Fix calculating size of compressed matrix