fix indents and parenthesis (to avoid warning with -W option)
File.exists? is deprecated; use File.exist?
remove unused variables (to avoid warning with -W option)