Fixes bug that was messing up the weights output.