Update matrix.h

Correct a stupid mistake, which creates segmental fault.