Fix reference to undefined object