Fix memory leak on construction fail