Fixed a crash when removing modal view controllers.
Merge pull request #167 from ChrisGrant/master

Fixed a crash when removing modal view controllers.