fixed bug accessing pointer of a matrix column