Select and other refactoring
Merge branch 'select-and-other-refactoring' into rc-0.4.0
fix after merge