Fix bug #1618, patch by Mark Bergsma. Stop using hardcoded value for maximum number...