Fix for Issue #64

Wrote a failing test and a fix.

The check for geometry type being null should avoid the NPE.