Added code to prevent doubling the size of the NN weights.