Fixed issue in tern remote query handler