Wow, I feel silly. In the process of making sample code I found the problem: I have been reading the output with a text editor instead of a hex editor. To think I spent hours on this problem... *face palm* Thanks for your quick replies.