Add tests to handle pin/unpin exceptions.