Updates to lincenses and bugfixes imported from the g2 project.