Fixed a gradient bug, but the SGD still isn't working properly