Fix reference field bug