Small bug fixing of undefined variables