Remove hack and actually detect filetype.
Merge pull request #38 from tobyk100/master

Remove hack and actually detect filetype.