fix quoting, fix numeric sorting with support with spaces in fragment names

Sending pull request again, also added quotes when concatenating the fragments together.