FIX val_max value reference