Merge "Revert "Some minor simplifications in code and tests.""