Further bugfixes to select