Fixes possible NPE.