In his talk "Fun with Free Field Theory", Seiberg discusses a topological quantum field theory in $d+1$ dimensions with the action $$ S = \frac{n}{2\pi} \int \phi\, \mathrm{d} a \tag{1}$$ where $\phi$ is a periodic scalar ($\phi \sim \phi + 2\pi$), $a$ is a $d$-form gauge field quantised such that $\int_M a \in 2\pi\mathbb{Z}$ for any $d$-cycle $M$, and $n$ is an integer. He writes down the correlation function $$ \left\langle \mathrm{e}^{\mathrm{i}\phi(p)} \mathrm{e}^{\mathrm{i}\oint_M a}\right\rangle = \mathrm{e}^{\frac{2\pi\mathrm{i}}{n} \ell}\tag{2} $$ where $p$ is a point, $M$ is a closed $d$-dimensional hypersurface, and $\ell$ is the linking number of $p$ and $M$. He says that since the theory is Gaussian (that is, free), it is straightforward to compute the partition function and get the above result by performing a Gaussian integral.
I don't understand how to do this. My main concern is that the path integral $$Z = \int \mathscr{D}\phi \mathscr{D}a\, \mathrm{e}^{-S}\tag{3}$$ doesn't look Gaussian to me. To me, the Gaussian integral is $$ \int\mathrm{d}^n\Phi\, \mathrm{e}^{-\frac{1}{2} \Phi^T M \Phi} = \frac{1}{\sqrt{\det(M/2\pi)}} \tag{4}$$ where $M$ is symmetric and positive definite, but if I try to define (in 1+1 dimensions for concreteness) $\Phi = (\phi, a_0, a_1)$, I get $$ \begin{align} S &= \frac{n}{2\pi} \int \mathrm{d}^2 x\, \mathrm{d}^2 y\, \frac{1}{2} \phi(\partial_0 a_1 - \partial_1 a_0) \\ &= \int \mathrm{d}^2 x\, \mathrm{d}^2 y\, \frac{1}{2} \Phi^T \underbrace{\frac{n}{4\pi} \delta^{(2)}(x - y) \begin{pmatrix} 0 & -\partial_1 & \partial_0 \\ \partial_1 & 0 & 0 \\ -\partial_0 & 0 & 0\end{pmatrix}}_{M(x,y)} \Phi \end{align}\tag{5} $$ and it seems like this operator $M$ surely has determinant $0$. Therefore, the path integral doesn't make sense, and in particular, I can't compute correlators by the standard method of introducing source terms and completing the square, because this would require inverting $M$.
I can think of three problems with what I have said:
My $M$ doesn't look symmetric because I performed partial integrations $\phi \partial_\mu a_1 \to -a_1 \partial_\mu \phi$ (but it is Hermitian?)
I haven't performed any gauge fixing or regularisation of the path integral, and
since $\phi$ is periodic and $a$ is quantised, the ordinary way of doing Gaussian integrals may not work.
Is the path integral really Gaussian? How would you go about computing it? Would taking the above "problems" into account solve the issue?
Any help is greatly appreciated!
Related: How does this Gaussian integral over the auxiliary field in 2D topological gauge theory work?