Fix path handling
*) Use File.expand_path as indicator for being an absolute path *) Use basename instead of parsing the path manually