Fergus,
I want to point out that it is, in fact, legal to move a pawn 2 squares on White's first move. It states in the rules (#3):
You may move an unmoved Pawn two spaces forward only on your second move or on White's very first move.
When I was trying to make my moves, not only was the double step on my first move illegal (as white), but also all the single steps and knight moves. I had no trouble after you modified the code, but as Jeremy just said, he is having the same issues.