SELECT fixes and improvements.