Fix error in filetype check.

Error also reported in #24.