Remove debugging code. Add improved delay checker.