Update nas and add tests