Added more tests to prevent undef value