Close everything properly