Added test cases for destructors and exception-safety