Fixed issue with NPE.