Instantiate $form before treating it like an array to avoid warnings.