fix reading from compressed matrix