Use correct time.sleep argument.

Use the correct time.sleep argument when sleeping. Also replace a post
for loop if check with an else to make the code more readable.

Change-Id: Icdfb41d1436abe930e4f45243ff6fe378ba3f91b
Merge "Use correct time.sleep argument."