VE-526 / VE-1458 Remove unneeded globals and commit missed code