Fix parts where the script got confused