fix as(...,"Matrix") issue