A few test and quality fixes