entity: fixed toArray()