Fixing some bugs in setting up of fields