fixed extension issue when '.' appears in the input filename, added test case input