Bug fixes in ArrayList.java