A lot of small fixes in the field generator