Fixed bad variable reference within onDayOfWeek().

Simple but required fix to use this script.
Great work on this by the way.