Change _theme_entityreference_pageshow() to place existing target ids in the hidden input's value when the form loads. Changed entityreference_assemble_form_state_into_field() to ignore empty string target ids, and instead return an empty array so the field's value(s) can be unset.