Check for null. Fixes #5.