Fix error in pulse loop.