XBee + library + arduino = freezes

I'm still struggling with the same issue.
I tried to send some data via xbee from PC using my own code and it works most of the time but then just hangs for no apparent reason. XCTU works fine though. I wonder what exactly they do that I don't?