Update test for issue 367 and add test for issue 381.