Properly apply map functions