first select() tests, several fixes