Split temporary tables on global and local, fix some typos