Added more tests for ArrayMap and fixed bugs they uncovered