Fix issue #341 where falsey values in iteration break getPath

Fix issue #341