nullpointer fix, closes #18