Fixed some bugs

Had some trouble with scaling, but I think that's fixed. Now I'm getting
that "weights sum to zero error" again.