Increase Maximum gain to 40K to deal with conversion of gain double to
indices.