Some servers returning references to an invalid index

Some servers returning references to an invalid index value if the SQL query returned
This solves the problem for both the Catalog and the Admin