Try to fix NPE. Fix #182.