few code fixes