fixed dimnames check on empty matrices