Merge Fix for GLASSFISH-21007

what if "valves" has size 0? (not sure if that's possible)