upgraded to recommended xCode settings
Fixed c-style casts. Introduced more extensive usage of Scoped guards