updating scripts and fixing tests