Added in more robust argument processing.