Many style and test improvements