Fix: don't try to remove extension from file name. There might be none.