Fix undefined test bug