Mostly code corrections, no new functionallity.