fix errors and retarget for ios 7