Fix regression errorArrayList.set() does not grow the collection, use add() instead.
More improvements on code style and compiler warnings