I use the older method and it is working as expected now. I uploaded the test project with the solutions I found, here: