Merge pull request #12 from nakedible/upstream-fixes

Add test cases