Fixed iCloud support

Fixes #55. Also updated the fix for #36.