Fixes for ios7 compatibility