Add search options and remove one bug with searching

Sorry for the many pull requests!