Improve code for iOS7.

See also: #14