Set range for config values.

Set some ranges to avoid unexpected behavior. But perhaps it should better be checked in code.