Added default gradient for nil data