Validating array lengths and object types

Some default values and tests were also found to be incorrect.