Add some test cases and comments

In response to gh-352