Branch 0 17 fixes

Hi vbmacher,
I found a couple of bugs in your code, here are my (quick and dirty) fixes.
They might also apply to 16bit instructions, didn't check it.