Redmine#2272: maparray() function
Redmine#2272: maparray() function style cleanup and return failure as needed