Fixed minor issues in timer code generation