fixes #84
add unit test for #84
revert file mode.
Merge pull request #92 from nosenaoki/master

fixes #84