Fixed a few problems with minimax implementation