- remove redundant NULL tests
- improve safety mof macro ObjStr()
- reduce variable scope