Fixed a bug in the form edit template, checking that values exist first.