Importing nbi.

Also fix build issues after major rewrites to the select
infrastructure.