Switched to using LBFGS by correcting gradinet resizing issue