I have a similar problem to this, the only difference, is that when I open the map up in notepad, there is no part that says entity 0. I tried adding in "classname" "worldspawn" anyway, but then the file size appears to go down and then when I compile and open it in JK2, it gives me an error, "Map has no nodes".
Basically, the first lines look like this:
// brush 0
then it goes right into the code. No entity 0 and worldspawn is under entity 23. I'm stumped... It worked every time before. Then I added to the map to finish off a section of it and it started doing this..