Check for null, fixes #56