Small fixes for Xcode templates

Also, uses `auto` in the template code to be more c++11 friendly