Fixed mapArrayToObject, and added max() function