Fixed issues when run with php-ng

Fixed several fails I met

thanks
I am not sure, the op.opline_num is not changed... why it can't be right?