ddt test fixes and some pep cleanup