remove use of non standard length function in rename script
improve error message in rename script
move closing parenthesis to end of line