Added initial state check + real timeout logic to test_hncp_sd, and found at least two unrelated bugs in hncp_sd.