It seems that SjaakII gets confused if you define the King as the first piece. I'm not sure why, but I'll look into that.
Ok, I fixed that. Turns out it wasn't actually confused, but the move information it passed to XBoard was wrong (so you would see spurious moves indicated in XBoard). Still looking for the castling issue.
EDIT: I think I found that too. If there's a commented-out line in a piece description, it's interpreted as an empty line that terminates the piece description. I'll go and fix that, but the work-around is simple: move the commented out line to the end of the piece description.
Did I really forget the bishop? Wow, that's silly.
Also, the King First thing actually explains a lot of the problems I've had where the King thinks he can move in more ways than he can.
Thanks for clarifying some issues.