It's far from clear if North Korea has achieved the ability to miniaturize a nuclear device to fit on a warhead yet. You don't need a nuclear warhead to make a ballistic missile destructive, but it is a distinct step that hasn't necessarily happened yet. This is important because North Korea is essentially retracing the steps of the US/USSR. The first tests were "devices"... basically lab experiments set to explode. Miniaturizing that and putting them in a mobile casing was the second step. And once that was achieved almost all tests were of would-be production weapon designs, and no longer lab experiment.
To put it simply, it's important to know if North Korea is testing a "device" or is testing a "warhead".
In any event, the clock is ticking for that. Of course North Korea, even poor as it is, will be able to replicate 1950s technology eaiser and cheaper in 2017, given enough time. And that's of course the way this has gone: North Korea has been given all the time its ever needed, and it keeps advancing.
Despite this failure there is no reason to think they won't succeed in the next few tests, and just build on that success.