Fixed a bug: now the code can handle incomplete games