fix for null values issue #15

This fix seems to work for issue #15 null values returning an error.