Fixed debug messages in EngCompletion()
Reorder EncodeSearch() in a more logical way