Watches out for NPE, fixing #83