Fixed bug in nmrihserver. Tidy up in other scripts