The timer in the above examples is named "1", not "timer1". Accessing a timer named "1" with $timer(timer1) does not work.