Ios8 fixes

Fixes #123, #188 and #189.