Fixed some NPE