Fix vector-size issue and selection sort