fix arrayWrite
numerous fixes, mostly for splice