Remove duplicates from library root

Closes #708
Would it not be nicer to prevent duplicate entries in the first place? Then you've got a single check rather than this on every call.