bugfixes

Added a break missing in a switch
Solve the reantrency problem in case of searching by index
Bugfixes