fix bug with matrix and type plants