I'm currently reading Topological Solitons by Manton & Sutcliffe and am having a bit of trouble with deriving an equation of motion. Suppose $M$ is a smooth manifold of dimension $D$ and $\mathbf{q}(t)=(q^1(t),...,q^D(t))$ is a smooth trajectory on $M$. Suppose we also have a scalar potential $V:M\rightarrow\mathbb{R}$, a Riemannian metric on $M$ with components $g_{ij}(\mathbf{q})$, and a local one-form with components $a_i(\mathbf{q})$. We can then define the Lagrangian density as $$L=\frac{1}{2}g_{ij}\dot{q}^i\dot{q}^j-a_i\dot{q}^i-V.$$ The Euler-Lagrange equations are $$\frac{d}{dt}\frac{\partial L}{\partial \dot{q}^i}-\frac{\partial L}{\partial q^i}=0$$ which are then written as $$\frac{d}{dt}\Big(g_{ij}\dot{q}^j-a_i\Big)-\frac{\partial}{\partial q^i}\Big(\frac{1}{2}g_{jk}\dot{q}^j\dot{q}^k-a_j\dot{q}^j-V\Big)=0.$$
I don't understand why there isn't a factor of $\frac{1}{2}$ in front of the $g_{ij}\dot{q}^j$ term and was wondering what I've missed here?