some code corrections

Corrections after Tonys remark