Make a proper cleanup