Added some null/Option checks. Closes #2