I believe that when doing a search and getting interrupted causes board conflict problems, ie pieces not getting replaced. Should probably turn off polling during a null search or something, or keep track of the number of fake_domoves.
Most likely the undomove function should check to see if the move it is undoing is an actual move, or a fake move. Test to see if move==dummymove or something.