Fixed sleeping errors causing problems.