Junky's right. If you port some code and it doesn't do what it originally did, then you have to isolate the cause of the discrepancy. If eyeballing the code hasn't worked, and nobody knows the secret...