Fix NPE; extract some strings