Fix positions table

This PR adds a check to avoid updating positions table after first phase. It also adds a method for table regeneration. It will run in the console.