Fix null ref in standalone mode.