The amendments to the Children's Wellbeing and Schools Bill were passed on Tuesday night in a session that ran into the early hours.