Only assign variables if not a string and only create a local variable if not a sized parameter. Fixes type mismatches in the generated code due to differences in the algorithms between creating local variables and using them.