Minor optimizations and iOS7 fixups + removed some warnings