Added sanity check to method to prevent exception from iOS bug, closes #796
Merge branch 'od/issue_796' into develop