Update to use newer version of mapply.