Add tests for issues 361-367