Undefined variable and wrong prefix fix