Restore globals lost during removal due to merge, remove unused variables and use threequals in new scripts.