fixes for temp tables