Fix undefined variable
Fix various undefined variables