Fixed destruction on error