Fixed issues when run with php-ng

Fixed several fails I met

thanks
Given that the goal of this code is to get the offset (jmp) from one op to the other, this change is correct.

The existing code is bad due to the long cast, which should never ever be used for pointers arithmetic.