Fixes #19 (NPE issue)