Fix some bugs in trakc prediction and wifi selection.