More fixes based on tests.