Updated script from master.