small changes and test fixes