Check if we can get children before iterating

Fixes #215