Fixes bugs related to iOS7