clean exit and more sleep fixes