Handling HasChild ES bug

Closes #585