fix casting warnings, compile in Xcode 5 & 6, ...

Modernize.