Update library list on the dialog when import on first run. 

A little ugly, but it works until you redo some things. 
Also fixes a couple of memory leaks.