Cleaning up the select loop.