Fixing up the Select method and finding bugs