Fix if file name contain more then one "."
Add debug option