Minor refactoring.
Merge branch 'master' into new-interface