Fix error in filetype check.

Error also reported in #24 (even though this is not the main problem).