Dear mailis,
you can use both an infinitive and a gerund after try, but with a difference in meaning.
try+doing = do something different, that I �ve never done before.
eg. Why don �t you try adding some cinnamon in your cupcakes, it �ll be delicious.
try+to do = make an effort to do sth
eg. I tried to solve the problem but it was too difficult and I gave up.
So I think that in your examples the gerund is correct, as you said! Take a look at learners dictionary for more examples, it �s online and for free!
Hope I helped!
Have a nice day!
Marileia