Minor refactoring.
Merge branch 'master' into add-rest-server