Added missing size for variable grad