Fixed issue with retreiving reference to rootViewController.
Merge pull request #5557 from borut-t/master

Fixed issue with retreiving reference to rootViewController.