Fix functions s:forward_search() and s:backward_search().