\spacefactor complaints

The errors

! You can't use `\spacefactor' in vertical mode.
\@->\spacefactor 
                 \@m 
or
! You can't use `\spacefactor' in math mode.
\@->\spacefactor 
                 \@m 
or simply
! Improper \spacefactor.
...
bites the LaTeX programmer who uses an internal command without taking "precautions". The problem is discussed in detail in "@ in macro names", together with solutions.

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atvert