Fix NPE in few places