Fixed all issues I could find

I removed all "hacks" from my config files, and cleaned this up until they all worked OK. I think at the weekend I'll split out the remove|replace case statement into seperate ones, it'll look neater and be more readable I think... even if it means a few extra lines in the script.

Steven.