Solved bug at matrix:max() and matrix:min() methods