Fix for ticket #878. Variables were send to xios after they were reset. They are now send before resetting.