Bugs fixes.

Handle if magic quotes turned on, and fix archive sort on some linux
distros.