Support logicals in MAT v5 format and fix tests