Fix some bugs. Improve game grid conversion