Fix “'NoneType' object is not iterable” error

Fixes #158