Fixing NaN's in the wb code