add tests for is.defined, fix is.defined