Clear out library

Is there any way to clear out the library completely when updating it?

I recently renamed and retagged a few files via the SMB share, then updated the folder from the web UI. The new tags do show up but some of the files now show up twice. Also, the list is not sorted.

I did a full update of the whole library but that made no difference.
I also SSHed into the box and checked /mnt/USB/folder/ and there are no duplicate files there.
I also checked the tags: Artist, Title, Album, Track, and Genre are populated. Album artist is not.

I eventually fixed the duplicates issue by deleting the folder, updating, then re-uploading and updating again.

However, the folder is still not sorted. Surely there must be a way to sort files?