Fixed bugs in timer and variable expansion.