This being conditional but not an error if an unexpected type seems odd; I would have expected it to either perform the rename unconditionally, or to treat non-string values as an error.