Fixes for upstream

minor cleanups which supposed not to change logic, but
make code cleaner.
I can revert the patch if there is a real reason to use new String("NULL"). Otherwise I will submit a pull request to remove the comment.