fixed some const issues
fixed regression which broke ll gradients