Added NPE protection.