The effect of the formulation of nonlinear terms on aliasing errors in spectral methods