Merge "Some minor simplifications in code and tests."
am: f3e4c8a7fc

* commit 'f3e4c8a7fc306aacf772beef5269ee9a466bea4c':
  Some minor simplifications in code and tests.