In procedure "GetRecords" there are two calls "ProcessElementsIn" function, which probably should be replaced by "GetRecords".