Corrected how WeightUpdate was called and how error is calculated.