Nil check. Fixes #154