Use file-name-extension where appropriate