cgi/g: update $field_number late enough
cgi/g: fix typo for LINEAREA handling