fix #239 Fixed NPE's

Somehow missed initialization of some stuff.