various non-related small changes and a couple of new tests