BUG/TST: Fix undefined vairable