Additional test cases for #356, #363, #412, and #413