Changed. Also I have added the check for names becoming too large, as R has a limit of 1000 byte names.