filetype/1 fix

Compaction of code
Merge pull request #2 from m-2k/master

filetype/1 fix