fix undef tests
todo
flesh out test cases some more
not working