fixes to deal with arrays