Add test cases. Updates #49.