Add some checks, and managed also the case where the first view controller is presented.