fixed two bugs in gtimer