Fix for weights read bug