minor enhancements to matrix library