Fixed NPE (I blame @MattBDev :P).