Added bounds chechking for getCell