Hello Robert,
Your explanations are no suprise for me. 8-)Sorry, I'm not even running Linux, so I couldn't test if my patches worked... But I'd recommend rewriting it from scratch and doing completely _without_ any delays (except when recovering from I2C bus errors).