Update .gitignore for xcode projects.
Fix compiler warnings for 'no newline at end of file'
Remove type comparison warning by doing the - useles - cast.