a few code corrections