Fixed periodic timer issue, fixed codestyle