Fixed some timeout bugs.