AI-704 : fixed infinite loop and added test (still need to investigate MULTIPLE_ROWS() on GetSites side)