added contract checks for hwm and connections

There were no checks for max_connections > 0 and highwatermark > 0.