Fixed warnings at when exiting