fix NPE
fix checkstyle errors
comments