fix handling of null and deleted data - fix issue #144

Fix for issue #144
@divdavem: thanks for the simple test case!