null handling

Fixes issue #33.