Added logic and tests to disable autoEncoding of arrays and objects