fix typed alloc of field elements