[BUGFIX] Wrong calculation of maximum value for checkbox fields