Fixed wake() bugs.