Fixed bug (remove dot with extension in fname).