Uses rowCount and columnCount and deals with null references