Fixed a bug in Timer and Counter