Improved NPE check: