Fix undefined variables