Fix obvious errors

Dimensions of gradients still don't really fit yet.