Added couple of null guards.