Fix shutdown counter

Bind timer repeating to the counter.
Actually power off when the counter reaches 0.