casting variables to subdue Xcode warnings