Correct bug in listing devices

Fill failed because k was not incremented.
Unique failed scanning freed memory.