Fix for non-string args being cast as strings

If you passed down a boolean/None value this funciton casts it as a string then checks what type the object is-- where i'm sure the intent was to create a copy of the original arg (thats what the comment says)