Ios keyboard crash fix

This addresses the crash reported in #428. Also took care of some iOS-only warnings, similar to the last round I did for OS X.