Added checking for args, being Arguments or an Array, or undefined.