Fix type and size validation.