Don't change the value of arg
Handle a few more edge cases