Fixed a bug in getAllChildren with nulls