fix test
improve test.sh and fix tests
Merge pull request #12 from tjhei/fix_tests

Looks good.