Added missing null check. Fixes #13