The edge case for files that end in . as argument gives error