Fix references on panic