Fixed bugs with printBoardToFile