Fix UnboundLocalError in string_join