Fixed a potential NPE.