Cleaned up argument parsing code.