fixing tests and code so that tests will pass using dryrun