cleanup in selects.c