Fixed various cosmetic bugs in timer code