Added .gitignore file.
Added explicit casts to remove warnings in OS X.