Merge memarray improvements from palette branch into trunk (nw)