Fix bug when searching for losses